#-------------------------------*- makefile -*---------------------------------
#
# Prior to OpenFOAM-v1906, these were always part of the environment
#
# - WM_CFLAGS   : with -m32 / -m64 and -fPIC
# - WM_LDFLAGS  : with -m32 / -m64
#
# With OpenFOAM-v1906 and later
#
# - wmake -show-cflags        : with -m32 / -m64
# - wmake -show-cflags-arch   : with -m32 / -m64
#
# Pass these in via the environment since using '$(shell ...)' here does not
# always work well.
#
# Notes:
# - compiled without pthread
#
# Normally set CCS, CCP by caller
#------------------------------------------------------------------------------

EXE         =
LIB         = .so
OBJ         = .o

AR          = $(CC)
ARFLAGS     = $(WM_CFLAGS) -shared -o
CCS        ?= $(CC)
CCP        ?= mpicc
CCD         = $(CCP)
CFLAGS      = $(WM_CFLAGS) -fPIC -O3 \
    -UCOMMON_FILE_COMPRESS \
    -DCOMMON_RANDOM_FIXED_SEED \
    -DSCOTCH_DETERMINISTIC \
    -DSCOTCH_RENAME \
    -Drestrict=__restrict

# 32-bit vs. 64-bit labels
ifeq ($(WM_LABEL_SIZE),64)
CFLAGS     += -DINTSIZE64
endif

CLIBFLAGS   = -shared
LDFLAGS     = -Xlinker --no-as-needed $(WM_LDFLAGS) -lm -lrt

MAKE        = make
CP          = cp
CAT         = cat
LN          = ln
MKDIR       = mkdir
MV          = mv
RANLIB      = echo
LEX         = flex -Pscotchyy -olex.yy.c
YACC        = bison -pscotchyy -y -b y

#------------------------------------------------------------------------------
